# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Matt Harrison <matt@harrison.us.com>
# Contributor: Erik van der Kolk <developer at smerik dot nl>
# Contributor: Hong Xu

pkgname=editorconfig-core-c
pkgver=0.12.1
pkgrel=2
pkgdesc="EditorConfig core code written in C (for use by plugins supporting EditorConfig parsing)"
arch=(i686 x86_64)
url="https://github.com/editorconfig/editorconfig-core-c"
license=(BSD)
depends=(pcre)
makedepends=(cmake)
source=($pkgname-$pkgver.tar.gz::"https://github.com/editorconfig/${pkgname}/archive/v$pkgver.tar.gz")
sha256sums=('c7bd714c73f01edde583b059b51078173aa85a36fa05bb9652d35a75fe0ac372')

prepare() {
  mkdir -p build
}

build() {
  cd build

  cmake ../$pkgname-$pkgver \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DINSTALL_HTML_DOC=ON \
      -DCMAKE_INSTALL_LIBDIR=lib
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install

  install -Dm644 "$srcdir"/$pkgname-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
